[qemu-dm] Fix debugging output in tpm tis model
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 20 Dec 2007 16:52:44 +0000 (16:52 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 20 Dec 2007 16:52:44 +0000 (16:52 +0000)
This fixes the debugging output.
Also I am tweaking on the code trying to establish a connection with
the external vTPM.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
tools/ioemu/hw/tpm_tis.c

index 3c679218222d533435a1ca333c0ace11c38c8501..a4742e6a4ade89e1c98c129b0ef6f54a70e4a167 100644 (file)
@@ -270,11 +270,11 @@ static int create_local_socket(tpmState *s, uint32_t vtpm_instance)
             }
 #ifdef DEBUG_TPM
             if (success)
-                fprintf(logfile,"Successfully connected using local socket "
-                                LOCAL_SOCKET_PATH ".\n");
+                fprintf(logfile," Successfully connected using local socket"
+                                "%s.\n",addr.sun_path);
             else
-                fprintf(logfile,"Could not connect to local socket "
-                                LOCAL_SOCKET_PATH ".\n");
+                fprintf(logfile," Could not connect to local socket "
+                                "%s.\n",addr.sun_path);
 #endif
         } else {
             success = 0;
@@ -905,9 +905,10 @@ void tpm_tis_init(SetIRQFunc *set_irq, void *opaque, int irq)
 
     register_savevm("tpm-tis", 0, 1, tpm_save, tpm_load, s);
 
+    open_vtpm_channel(s);
     for (c = 0; !IS_COMM_WITH_VTPM(s) && (c < 5); c++) {
-       open_vtpm_channel(s);
        sleep(1);
+       open_vtpm_channel(s);
     }
 }